<link rel="stylesheet" href="__PUBLIC__/yksui/css/zui.css" rel="stylesheet"/>
<style>
    .w120{width: 80px;}
</style>
<div class="container" style="margin-top: 20px;">
    <form  id="carrierForm" action="__URL__/doEditCarrier" method="post">
        <volist name="cdetail" id="vo">
        <table class="table table-bordered">
            <tr>
                <th>承运商名称：</th>
                <td><input type="text" name="name" value="{$vo.name}" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th class="Wdate">提货时间：</th>
                <td><input type="text" name="pickingtime" value="{$vo.pickingtime}" id="pickingtime"/><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>提货地点：</th>
                <td><input type="text" name="pickingaddress" value="{$vo.pickingaddress}" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>结款方式：</th>
                <td><input type="text" name="paymethod" value="{$vo.paymethod}" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>计费方式：</th>
                <td><input type="text" name="billingway" value="{$vo.billingway}" /><span style="color: red">*</span></td>
            </tr>
            <tr>
                <th>承运伤状态：</th>
                <td>
                    <span >开启<input  type="radio" name="is_used" value="1" checked /></span>
                    <span>关闭<input  type="radio" name="is_used" value="0"/></span>
                </td>
            </tr>
        </table>
            <foreach name="vo['service']" item="se" key="num">
            <table class="table table-bordered">
                <thead>
                <tr>
                <th>服务名称</th>
                <th class="Wdate">时效（天）</th>

                <th>是否启用</th>
                      </tr>
                </thead>
                <tbody>

                <tr>
                    <td>
                        <input type="text" class="form-control w120" name="service_name[]" value="{$se.service_name}" placeholder="">
                    </td>
                    <td>
                        <input type="text" class="form-control w120" name="aging[]" value="{$se.aging}" placeholder="">
                    </td>

                    <td>
                        <input name="service_id[]" type="hidden" value="{$se.service_id}">
                        <input name="service_is_used{$num}" value="1" type="radio"  <if condition="$se.service_is_use eq 1">checked</if>>
                        启用<br/>
                        <input name="service_is_used{$num}" value="0" type="radio" <if condition="$se.service_is_use eq 0">checked</if>>
                        关闭
                    </td>

                </tr>

                </tbody>
            </table>
            </foreach>
     </volist>
<div class="clearfix"></div>
<div class="text-center">
        <input type="submit" id="sub" class="btn btn-primary jsSearchBtn " /></div>
        <input type="hidden" name="id" id="id" value="{$vo.id}" />
    </form>
</div>

<script type="text/javascript" src="__PUBLIC__/javascripts/admin/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/javascripts/admin/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/javascripts/admin/layer/layer.js"></script>
<script type="application/javascript">
    $(function () {
//
//        $("#sub").on('click', function () {
//            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
//            layer.load();
//            $.ajax({
//                url: "{:U('Carrier/doEditCarrier')}",
//                type: 'post',
//                async: false, //default: true
//                data: $('#carrierForm').serialize(),
//                dataType: 'json', // default: Intelligent Guess (xml, json, script, or html)
//                success: function (data, textStatus, jqXHR) {
////                    alert(data);
////                    if(data=='修改成功'){
////                        parent.location.reload();
////                        parent.layer.close(index); //执行关闭
////                    }
////                    layer.closeAll('loading');
////                    layer.msg(data);
////                }
//
////        })
//                    if(data=='修改成功'){
//                        parent.location.reload();
//                        parent.layer.close(index); //执行关闭
//                    }
//                }
//            },1000)
//        })
        /**
         * 日期时间选择
         */
        $('#pickingtime').click(function () {
            WdatePicker({skin: 'twoer', dateFmt: 'HH:mm:00'})
        })


    })
</script>


